﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CheckRes : MonoBehaviour {





	// Use this for initialization
	void Start () {

		Loading.GetInstance ().StartLoading ();

		int count = 0;
		// 检查是否有网络
		if (Application.internetReachability != NetworkReachability.NotReachable) {
		
			Debug.Log ("in");
			// 有网，下载配置文件
			ResLoader.Load(DataManager.urlGame, null, (www)=>{
				count++;
				if ( count >= 3 )
				{
					// next step
					Loading.GetInstance ().EndLoading();
				}
			}, true, false);

			ResLoader.Load(DataManager.urlLesson, null, (www)=>{
				count++;
				if ( count >= 3 )
				{
					// next step
					Loading.GetInstance ().EndLoading();
				}
			}, true, false);

			ResLoader.Load(DataManager.urlVideo, null, (www)=>{
				count++;
				if ( count >= 3 )
				{
					// next step
					Loading.GetInstance ().EndLoading();
				}
			}, true, false);

		}


	}

}
